package com.yumeng.config.properties;

import com.yumeng.common.buss.area.AreaBussMode;
import com.yumeng.common.buss.area.SysAreaLevel;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 *
 * @author wxd
 * @date 2025/10/14 17:16
 */
@Getter
@Setter
@Component(YumengBussProperties.DEFAULT_BEAN_NAME)
@ConfigurationProperties(prefix = "yumeng.buss")
public class YumengBussProperties {

    public static final String DEFAULT_BEAN_NAME = "YumengBussProperties";

    private SysArea area;


    @Getter
    @Setter
    public static class SysArea{

        /**
         * 当前系统地区级别
         */
        private SysAreaLevel sysAreaLevel;
        /**
         * 当前系统地区编号
         */
        private String sysAreaCode;
        /**
         * 当前系统地区名称
         */
        private String sysAreaName;
        /**
         * 当前地区业务模式
         */
        private AreaBussMode areaBussMode;

        public boolean hasUsefulAreaInfo(){
            return this.sysAreaLevel != null && StringUtils.isNotBlank(this.sysAreaCode) && StringUtils.isNotBlank(this.sysAreaName) && this.areaBussMode != null;
        }

    }
}
